import { defineStore } from 'pinia'
import { computed, ref } from 'vue'

export const useGlobalStore = defineStore(
    'global',
    () => {
        let isCollapse = ref(false)
        let title = ref('Payfaz商户平台')
        let currentIsCollapse = computed(() => {
            return isCollapse
        })
        // 设置isCollapse
        function setIsCollapse() {
            isCollapse.value = !isCollapse.value
        }
        let currentTitle = computed(() => {
            return title
        })


        return { isCollapse, currentIsCollapse, setIsCollapse, title, currentTitle }
    },
    {
        persist: true
    }
)